package com.ikas.ai.server.module.condition.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum MachineConditionMeteCodeInfoEnum {

    U01_G("U01", "1CRK00_MODE_DZ_G", 1206L,"G"),
    U01_P("U01", "1CRK00_MODE_DZ_P", 1195L,"P"),
    U01_PC("U01", "1CRK00_MODE_DZ_PC",1188L, "PC"),

    U02_G("U02", "2CRK00_MODE_DZ_G", 7357L,"G"),
    U02_P("U02", "2CRK00_MODE_DZ_P", 7346L,"P"),
    U02_PC("U02", "2CRK00_MODE_DZ_PC", 7339L,"PC"),

    U03_G("U03", "3CRK00_MODE_DZ_G",13529L, "G"),
    U03_P("U03", "3CRK00_MODE_DZ_P", 13518L,"P"),
    U03_PC("U03", "3CRK00_MODE_DZ_PC", 13511L,"PC"),

    U04_G("U04", "4CRK00_MODE_DZ_G",19710L, "G"),
    U04_P("U04", "4CRK00_MODE_DZ_P", 19699L,"P"),
    U04_PC("U04", "4CRK00_MODE_DZ_PC",19692L, "PC"),
    ;

    private String machineNo;
    private String meteCode;
    private Long meteId;
    private String wcName;
    public static <T extends MachineConditionMeteCodeInfoEnum> T getEnumByMeteCode(Class<T> clazz, String meteCode) {
        for (T machineRunStopEnum : clazz.getEnumConstants()) {
            if (meteCode.equals(machineRunStopEnum.getMeteCode())) {
                return machineRunStopEnum;
            }
        }
        return null;
    }
}
